﻿
namespace PivotPhysicsPlotsGenerator.Utilities
{
    static class General
    {
        /// <summary>
        /// Remove any trailing "/"'s
        /// </summary>
        /// <param name="p"></param>
        /// <param name="p_2"></param>
        /// <returns></returns>
        public static string RemoveTrailing(this string baseStr, string trailingStringToRemove)
        {
            int index = baseStr.LastIndexOf(trailingStringToRemove);
            if (index + trailingStringToRemove.Length == baseStr.Length)
            {
                return baseStr.Substring(0, index);
            }
            return baseStr;
        }
    }
}
